<!--
 * @Author: your name
 * @Date: 2021-05-17 09:50:47
 * @LastEditTime: 2021-05-17 09:56:40
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \shopd:\HTML001\布局小技巧\栅格\栅格.html
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>栅格</title>
    <style>
      * {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
      }
      .out{
          width: 400px;
          height: 100px;
          border: 1px solid greenyellow;
          overflow-x: scroll;
      }
      .box {
        width: 800px;
        height: 100px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, 1fr);
        border: 1px solid blueviolet;
      }
      .box div {
        width: 200px;
        height: 50px;
        border: 1px solid red;
      }
    </style>
  </head>
  <body>
    <div class="out">
      <div class="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <div>7</div>
        <div>8</div>
        <div>9</div>
      </div>
    </div>
  </body>
</html>
